struct Solution {}

fn main() {}

impl Solution {
    pub fn get_row(row_index: i32) -> Vec<i32>  {
        if row_index == 0 {
            return vec![1];
        }
        if row_index == 1 {
            return vec![1, 1];
        }
        if row_index == 2 {
            return vec![1, 2, 1];
        }

        let mut before_vec = vec![1, 1];
        let mut ret_vec = vec![];
        for row in 3..=(row_index + 1) {
            ret_vec = vec![1];
            for num_cnt in 0..(row - 2) {
                ret_vec.push(before_vec[(num_cnt + 1) as usize] + before_vec[(num_cnt) as usize]);
            }
            ret_vec.push(1);
            before_vec = ret_vec.clone();
        }
        ret_vec
    }
}